File Keys
For each indexed file, you specify a primary key and up to 16 alternate keys. A primary key is required for each file, while alternate keys are optional.
A primary keyprovides the default key path by which to access and retrieve specific records in an indexed file. Unless otherwise specified by a user or designer, the primary key path is always used. The field you designate as the primary key should generally be short and must be unique. A primary key is often used as a link to data in other files. Examples of primary keys include a customer number in a customer file or a product code in a product file. Appx Date/Time fields normally cannot be used as a primary key since the speed of computers would most likely create multiple records within a hundreth of a second, the smallest level of precision for a date/time field.
Alternate keys provide optional key paths by which to access and retrieve specific records in an indexed file. A user or designer may optionally choose to change from the primary key path to any alternate key path for record access and retrieval. Examples of alternate keys to a customer file might include customer name or phone number.
APPX allows you to have duplicate alternate key values in a file, although a unique primary key is required. For each key path, you specify whether duplicate key values are allowed.
When you define a field to be the key to your file, there are two fields in the Key Control pop-up box in addition to Key Type: Key/Field Order can be defined as ASCENDING or DESCENDING. The default is ASCENDING.
User Selectable? determines whether or not a user can switch to a key path with the Select Access Path option from within an input process. The default is 'yes' .
A field does not have to be designated as a key to be used as a sort field in query processes. During sorting, APPX can use any fields to generate the required sort order. A File Key Field cannot contain an occurrence specification. This is true for both a single field or a field defined within a Group. |